package com.zhentao.controller;

import com.zhentao.model.article.dto.CountDto;
import com.zhentao.model.article.dto.LikesBehaviorDto;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.service.BehaviorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/")
public class BehaviorController {
    @Autowired
    private BehaviorService behaviorService;

    @PostMapping("likes_behavior")
    public ResponseResult likesBehavior(@RequestBody LikesBehaviorDto dto){
        return behaviorService.likesBehavior(dto);
    }
    @PostMapping("read_behavior")
    public ResponseResult readBehavior(@RequestBody CountDto dto){
        return behaviorService.read_behavior(dto);
    }
    @PostMapping("un_likes_behavior")
    public ResponseResult unLikesBehavior(@RequestBody CountDto dto){
        return behaviorService.unLikesBehavior(dto);
    }
}
